#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <math.h>
int is_prime(int n)
{
	for (int i = 2; i <= sqrt(n); i++)
		if (n % i == 0)
			return 0;
		
	if (n == 1)  //注意:1不是素数
		return 0;
	else
		return 1;
}

int main()
{
	int m, n, count = 0, sum = 0;
	scanf("%d %d", &m, &n);

	for (int i = m; i <= n; i++)
	{
		if (is_prime(i))
		{
			count++;
			sum += i;
		}
	}

	printf("%d %d", count, sum);
	return 0;
}